
// 子页面链接
// http://www.tower.com.cn/pshop/v2/stage/front/#/EcomPurchase/commodityOrder
//
	
// 获取最子集 iframe

if(!zq_lc){
	
	try{
		var zq_lc = document.getElementById("mainframe").contentWindow.document.getElementById("iframeId").contentWindow.document.getElementById("listContent").contentWindow;
	}catch(e){
		var zq_lc = window
	}
	
	
}


// 得到formOptions集合
let zq_formOptions=zq_lc.document.querySelector("#resize-container").__vue__._data.formOptions;

// 修改默认限定时间范围
zq_formOptions.formItems[3].pickerOptions.disabledDate=e=>void(0);
zq_formOptions.formItems[4].pickerOptions.disabledDate=e=>void(0);

// 修改onchange事件阻止事件刷新
zq_formOptions.formItems[3].on.change=t=>void(0);
zq_formOptions.formItems[4].on.change=t=>void(0);

// 增加200页下拉框
zq_lc.document.querySelector(".el-pagination__sizes").style.display='inline-block';
zq_lc.document.querySelector(".el-table thead th, .el-table thead tr").style.background='#66ccff';
// 切换
let zq_pg = zq_lc.document.querySelector("#resize-container > div > div:nth-child(2) > div > div.el-card.is-always-shadow > div > div.table-paganation-footer > div.el-pagination.is-background").__vue__;
let zq_table = document.querySelector("#resize-container > div").__vue__;
zq_table.pagination.pageSize=200;
zq_pg.$props.pageSizes.push(99999999);

// 增强提示
let style = zq_lc.document.createElement("style");
style.appendChild(zq_lc.document.createTextNode(`.el-table thead th{background:#66ccff}`));
zq_lc.document.head.appendChild(style);

// 复制按钮模板
let templatebtn = zq_lc.document.querySelector("#resize-container > div > div.search-form-card > div > div > form > div.text-center > button:nth-child(2)");

// 下拉框快捷按钮
let downSelect = zq_lc.document.querySelector("#resize-container > div > div.search-form-card > div > div > form > div.form-body.el-row > div:nth-child(2) > div > div > div");

let ACCEPT_btn = templatebtn.cloneNode(true);
let NOT_ACCEPT_btn = templatebtn.cloneNode(true);

templatebtn.parentNode.insertBefore(ACCEPT_btn,templatebtn.nextSibling);
templatebtn.parentNode.insertBefore(NOT_ACCEPT_btn,templatebtn.nextSibling);
ACCEPT_btn.children[0].innerText='供应商已接单';
NOT_ACCEPT_btn.children[0].innerText='供应商未接单';
ACCEPT_btn.style.background="#FFAA00";
NOT_ACCEPT_btn.style.background="#7608AA";
ACCEPT_btn.style.color="#FFFFFF";
NOT_ACCEPT_btn.style.color="#FFFFFF";
function resetDownSelect(txt){
	let prop = downSelect.__vue__;
	prop.value.splice(0,prop.value.length);
	prop.value.push(txt);
};

ACCEPT_btn.onclick=function(e){resetDownSelect("ACCEPT");};
NOT_ACCEPT_btn.onclick=function(e){resetDownSelect("NOT_ACCEPT");}; 


// 时间填充默认值

function dateStr(d){
	var curr_date = d.getDate();
	var curr_month = d.getMonth() + 1; 
	var curr_year = d.getFullYear();
	String(curr_month).length < 2 ? (curr_month = "0" + curr_month): curr_month;
	String(curr_date).length < 2 ? (curr_date = "0" + curr_date): curr_date;
	return curr_year + "-" + curr_month +"-"+ curr_date;
}


let zq_starttime = zq_lc.document.querySelector("#resize-container > div > div.search-form-card > div > div > form > div.form-body.el-row > div:nth-child(4) > div > div > div > input");
let zq_endtime = zq_lc.document.querySelector("#resize-container > div > div.search-form-card > div > div > form > div.form-body.el-row > div:nth-child(5) > div > div > div > input");
zq_starttime.value=dateStr(new Date(new Date() - 1000*60*60*24 * 180));
zq_endtime.value=dateStr(new Date());
var zq_changeEvent = zq_lc.document.createEvent('HTMLEvents');
zq_changeEvent.initEvent('change', true, true);
zq_changeEvent.eventType = 'message';
var zq_inputEvent = zq_lc.document.createEvent('HTMLEvents');
zq_inputEvent.initEvent('input', true, true);
zq_inputEvent.eventType = 'message';


zq_starttime.dispatchEvent(zq_inputEvent);
zq_starttime.dispatchEvent(zq_changeEvent);



// 点击查询
let zq_searchBtn = document.querySelector("#resize-container > div > div.search-form-card > div > div > form > div.text-center > button.el-button.el-button--primary");
var zq_clickEvent = zq_lc.document.createEvent('HTMLEvents');
zq_clickEvent.initEvent('click', true, true);
zq_clickEvent.eventType = 'message';

zq_searchBtn.dispatchEvent(zq_clickEvent);


// 回调
void 0;






